KISHAN KUMAR S D, HRUTHIK K K , KIRAN V-R V COLLEGE OF ENGINEERING(CSE 6TH SEM)-Implement Clang identifiers to retrieve the mangled name and the fully qualified name of functions #5 #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
__fq_func__and__mangled_func__predefined identifiers to ClangSummary
This pull request introduces two new predefined identifiers to Clang:
__fq_func__- Returns the fully qualified name of the current function__mangled_func__- Returns the mangled name of the current functionAffected Files
llvm-project/clang/include/clang/AST/Expr.hllvm-project/clang/lib/AST/Expr.cppllvm-project/clang/include/clang/Basic/TokenKinds.defllvm-project/clang/lib/Sema/SemaExpr.cppllvm-project/clang/lib/Parse/ParseExpr.cppMotivation
The existing predefined identifiers have limitations:
__func__: Only unqualified name__PRETTY_FUNCTION__: Detailed signature without full qualificationNew identifiers provide:
__fq_func__)__mangled_func__)Implementation Details
New
PredefinedIdentKindenum values:FQFunctionMangledFunctionCore implementations:
1)
Expr.h→llvm-project/clang/include/clang/AST/Expr.h2)Expr.cpp-->llvm-project/clang/lib/AST3)TokenKinds.def-->llvm-project/clang/include/clang/Basic/TokenKinds.def4)SemaExpr.cpp-->llvm-project/clang/lib/Sema/SemaExpr.cpp5)ParseExpr.cpp-->llvm-project/clang/lib/Parse/ParseExpr.cppExample Usage